.lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    overflow: auto; /* Ermöglicht Scrollen, falls nötig */
    padding: 20px; /* Abstand zum Rand */
    box-sizing: border-box;
}

.lightbox-title {
    color: #fff!important; /* Weiß für bessere Lesbarkeit */
}

.lightbox-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90%;
    max-height: 90vh; /* Begrenzung der maximalen Höhe relativ zur Ansichtshöhe */
    overflow: hidden;
    box-sizing: border-box;
}

.lightbox-header {
    position: absolute;
    top: 0;
    width: 100%;
    text-align: center;
    color: white;
    padding: 10px 0;
    z-index: 10;
    background: rgba(0, 0, 0, 0.5); /* Hintergrund für bessere Lesbarkeit */
}

.lightbox-img-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1 1 auto; /* Ermöglicht dem Container, den verfügbaren Platz zu nutzen */
    width: 100%;
    overflow: hidden;
    margin-top: 60px; /* Platz für den Header */
    margin-bottom: 20px; /* Platz für die Thumbnails */
    box-sizing: border-box;
}

.lightbox-img {
    max-width: 100%;
    max-height: 100%;
    width: auto; /* Dynamische Breite */
    height: auto; /* Dynamische Höhe */
    transition: transform 0.3s ease;
    cursor: zoom-in;
    border-radius: 10px;
    object-fit: contain; /* Verhindert Zuschneiden und Verzerrung */
}

.lightbox-hover-text {
    position: absolute;
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    background: rgba(0, 0, 0, 0.5);
    padding: 5px 10px;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 10;
}

.lightbox-img-container:hover .lightbox-hover-text {
    opacity: 1;
}

.lightbox-thumbnails {
    display: flex; /* Flex-Layout für bessere Anpassung */
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 25px;
    max-width: 100%;
    overflow-x: auto; /* Ermöglicht horizontales Scrollen bei vielen Thumbnails */
    box-sizing: border-box;
}

.lightBox-edit {
    display: flex;
}

.thumbnail {
    width: 50px;
    height: 50px; /* Einheitliche Größe der Thumbnails */
    object-fit: cover; /* Beibehaltung des Seitenverhältnisses */
    cursor: pointer;
    border-radius: 2px;
}

.current-thumbnail {
    border: 2px solid #F3DA65; /* Hervorhebung des aktuellen Thumbnails */
    opacity: 0.6;
}

.close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 30px;
    cursor: pointer;
    color: white;
    z-index: 20;
}

.download-btn {
    position: absolute;
    bottom: 20px;
    right: 30px;
    font-size: 20px;
    color: white;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 10px;
    text-decoration: none;
    border-radius: 5px;
    z-index: 20;
}

.navigation {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
}

.prev, .next {
    font-size: 30px;
    color: white;
    cursor: pointer;
    padding: 20px;
    user-select: none;
}

.prev:hover, .next:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Responsive Anpassungen für mobile Geräte bleiben unverändert */
@media screen and (max-width: 768px) {
    .lightbox-content {
        max-width: 100%;
        max-height: 100%;
    }

    .lightbox-img-container {
        max-height: 60vh; /* Reduzierte Höhe für mobile Geräte */
    }

    .thumbnail {
        width: 40px;
        height: 40px;
    }

    .close {
        top: 10px;
        right: 15px;
        font-size: 25px;
    }

    .download-btn {
        bottom: 10px;
        right: 15px;
        font-size: 16px;
        padding: 8px;
    }

    .prev, .next {
        font-size: 25px;
        padding: 15px;
    }
}

/* Zusätzliche Desktop-spezifische Anpassungen */
@media screen and (min-width: 769px) {
    .lightbox-content {
        /* Optional: Weitere Anpassungen für große Bildschirme */
    }

    .lightbox-img-container {
        /* Stellen Sie sicher, dass der Container genug Platz für hohe Bilder bietet */
        max-height: 80vh; /* Erhöhte maximale Höhe */
    }

    .lightbox-thumbnails {
        /* Stellen Sie sicher, dass die Thumbnails immer vollständig sichtbar sind */
        margin-top: 15px; /* Weniger Abstand, um mehr Platz für Thumbnails zu haben */
    }

    .navigation {
        /* Optional: Anpassungen an den Navigationspfeilen, falls nötig */
    }
}
